<?php

$project = $page->project();
$page->title = $project->getTitle();

?>

<article class="gallery__image onPaper">
    <h1><?= $project->getTitle() ?></h1>

    <figure class="image__cover">
        <img src="<?= $project->getCover() ?>">
    </figure>

    <?php if($project->hasDescription()): ?>
    <?= $project->getDescription() ?>
    <?php endif ?>

    <h2>Photos</h2>

    <ul class="block-grid three-up">
    <?php foreach($project as $photo): ?>
        <li>
            <figure>
                <a href="<?= $project->getId() . '/' . $photo->getId() ?>">
                    <img src="<?= $photo->getThumb() ?>">
                </a>
                <figcaption>
                    <p><?= $photo->getCaption() ?></p>
                </figcaption>
            </figure>
        </li>
    <?php endforeach ?>
    </ul>

    <p><a href="<?= url(uri::back()) ?>">Back to the Portfolio</a></p>

</article>
